using System.ComponentModel.DataAnnotations;

namespace Sheep_Breeding.Write.Api.DTOs
{
    /// <summary>
    /// 羊只采购添加DTO
    /// </summary>
    public class AddSheepPurchaseDto
    {
        /// <summary>
        /// 采购日期
        /// </summary>
        [Required(ErrorMessage = "采购日期不能为空")]
        public DateTime PurchaseDate { get; set; }

        /// <summary>
        /// 采购员ID
        /// </summary>
        [Required(ErrorMessage = "采购员不能为空")]
        public long PurchaserId { get; set; }

        /// <summary>
        /// 羊只类型ID
        /// </summary>
        public long? SheepTypeId { get; set; }

        /// <summary>
        /// 批次号/耳号
        /// </summary>
        [StringLength(100, ErrorMessage = "批次号/耳号长度不能超过100个字符")]
        public string BatchNumber { get; set; } = string.Empty;

        /// <summary>
        /// 栏位ID
        /// </summary>
        public long? PenId { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [StringLength(10, ErrorMessage = "性别长度不能超过10个字符")]
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 标签
        /// </summary>
        [StringLength(200, ErrorMessage = "标签长度不能超过200个字符")]
        public string Tag { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位
        /// </summary>
        [StringLength(20, ErrorMessage = "计量单位长度不能超过20个字符")]
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 入库数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 只均单价
        /// </summary>
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 单位折扣
        /// </summary>
        public decimal? Discount { get; set; }

        /// <summary>
        /// 调整金额
        /// </summary>
        public decimal? Adjustment { get; set; }

        /// <summary>
        /// 结算金额
        /// </summary>
        public decimal? FinalAmount { get; set; }

        /// <summary>
        /// 总重量
        /// </summary>
        public decimal? TotalWeight { get; set; }

        /// <summary>
        /// 核算单元ID
        /// </summary>
        public long? AccountingUnitId { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [StringLength(500, ErrorMessage = "摘要长度不能超过500个字符")]
        public string Summary { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(1000, ErrorMessage = "备注长度不能超过1000个字符")]
        public string Remark { get; set; } = string.Empty;
    }

    /// <summary>
    /// 羊只采购更新DTO
    /// </summary>
    public class UpdateSheepPurchaseDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Required(ErrorMessage = "ID不能为空")]
        public long Id { get; set; }

        /// <summary>
        /// 采购日期
        /// </summary>
        [Required(ErrorMessage = "采购日期不能为空")]
        public DateTime PurchaseDate { get; set; }

        /// <summary>
        /// 采购员ID
        /// </summary>
        [Required(ErrorMessage = "采购员不能为空")]
        public long PurchaserId { get; set; }

        /// <summary>
        /// 羊只类型ID
        /// </summary>
        public long? SheepTypeId { get; set; }

        /// <summary>
        /// 批次号/耳号
        /// </summary>
        [StringLength(100, ErrorMessage = "批次号/耳号长度不能超过100个字符")]
        public string BatchNumber { get; set; } = string.Empty;

        /// <summary>
        /// 栏位ID
        /// </summary>
        public long? PenId { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [StringLength(10, ErrorMessage = "性别长度不能超过10个字符")]
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 标签
        /// </summary>
        [StringLength(200, ErrorMessage = "标签长度不能超过200个字符")]
        public string Tag { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位
        /// </summary>
        [StringLength(20, ErrorMessage = "计量单位长度不能超过20个字符")]
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 入库数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 只均单价
        /// </summary>
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 单位折扣
        /// </summary>
        public decimal? Discount { get; set; }

        /// <summary>
        /// 调整金额
        /// </summary>
        public decimal? Adjustment { get; set; }

        /// <summary>
        /// 结算金额
        /// </summary>
        public decimal? FinalAmount { get; set; }

        /// <summary>
        /// 总重量
        /// </summary>
        public decimal? TotalWeight { get; set; }

        /// <summary>
        /// 核算单元ID
        /// </summary>
        public long? AccountingUnitId { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [StringLength(500, ErrorMessage = "摘要长度不能超过500个字符")]
        public string Summary { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(1000, ErrorMessage = "备注长度不能超过1000个字符")]
        public string Remark { get; set; } = string.Empty;
    }

    /// <summary>
    /// 羊只采购删除DTO
    /// </summary>
    public class DeleteSheepPurchaseDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Required(ErrorMessage = "ID不能为空")]
        public long Id { get; set; }
    }

    /// <summary>
    /// 羊只采购查询DTO
    /// </summary>
    public class SearchSheepPurchaseDto
    {
        /// <summary>
        /// 采购员ID
        /// </summary>
        public long? PurchaserId { get; set; }

        /// <summary>
        /// 羊只类型ID
        /// </summary>
        public long? SheepTypeId { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        public string? BatchNumber { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 羊只采购结果DTO
    /// </summary>
    public class SheepPurchaseResultDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 采购日期
        /// </summary>
        public DateTime PurchaseDate { get; set; }

        /// <summary>
        /// 采购员ID
        /// </summary>
        public long PurchaserId { get; set; }

        /// <summary>
        /// 采购员姓名
        /// </summary>
        public string? PurchaserName { get; set; }

        /// <summary>
        /// 羊只类型ID
        /// </summary>
        public long? SheepTypeId { get; set; }

        /// <summary>
        /// 羊只类型名称
        /// </summary>
        public string? SheepTypeName { get; set; }

        /// <summary>
        /// 批次号/耳号
        /// </summary>
        public string BatchNumber { get; set; } = string.Empty;

        /// <summary>
        /// 栏位ID
        /// </summary>
        public long? PenId { get; set; }

        /// <summary>
        /// 栋舍名称
        /// </summary>
        public string? PenName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 标签
        /// </summary>
        public string Tag { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位
        /// </summary>
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 入库数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 只均单价
        /// </summary>
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal? Amount { get; set; }

        /// <summary>
        /// 单位折扣
        /// </summary>
        public decimal? Discount { get; set; }

        /// <summary>
        /// 调整金额
        /// </summary>
        public decimal? Adjustment { get; set; }

        /// <summary>
        /// 结算金额
        /// </summary>
        public decimal? FinalAmount { get; set; }

        /// <summary>
        /// 总重量
        /// </summary>
        public decimal? TotalWeight { get; set; }

        /// <summary>
        /// 核算单元ID
        /// </summary>
        public long? AccountingUnitId { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        public string Summary { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string? CreateUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改人姓名
        /// </summary>
        public string? UpdateUserName { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        public string? ApprovalUserId { get; set; }

                /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? ApprovalTime { get; set; }
    }
} 